package com.gushiyi.controller;

import com.gushiyi.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("user")
@Api("用户管理")
public class UserController {

    @GetMapping("getAll")
    @ApiOperation(value="查询用户",notes="查询所有用户")
    public List<User> getAll(){

        List<User> users = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            User user = new User();
            user.setId(i+1);
            user.setUsername("admin"+(i+1));
            user.setPassword("123456");
            users.add(user);
        }
        return users;
    }

}
